package springsecuritylearn.springsecuritylearn.hello5;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 视图配置
 *
 * @author zhoufei
 * @class: MvcConfig
 * @date 2020/10/24 21:03
 * @Verson 1.0 -2020/10/24 21:03
 * @see
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        //请求/ 跳转到login页面
        registry.addViewController("/").setViewName("login");
        //请求/login 跳转到login页面
        registry.addViewController("/login").setViewName("login");
    }
}